<template>
    <div class="w-full max-w-3xl mx-auto px-4">
        <!-- 公告处 -->
        <div class="divCommon bg-white/40 rounded-lg shadow-sm p-4 mb-4 transition-all hover:shadow-md">
            <h3 class="text-lg font-semibold text-gray-800 mb-3 border-l-4 border-blue-500 pl-2">
                公告栏
            </h3>
            <div class="space-y-2">
                <div v-for="(info, index) in props.info?.information" :key="index"
                    class="group flex items-start hover:bg-gray-50 px-2 py-1 rounded">
                    <span class="text-blue-500 mr-2">•</span>
                    <p class="text-gray-600 text-base break-words whitespace-normal min-w-0">
                        {{ info?.title }}
                    </p>
                </div>
            </div>
        </div>

        <!-- 最新评论 -->
        <div class="divCommon bg-white/40 rounded-lg shadow-sm p-4 transition-all hover:shadow-md">
            <h3 class="text-lg font-semibold text-gray-800 mb-3 border-l-4 border-green-500 pl-2">
                最新评论信息
            </h3>
            <div class="space-y-2">
                <div v-for="(item, index) in props.info?.newComment" :key="index" class="w-full bg-gray-50/40 rounded-lg px-3 py-2 hover:bg-gray-100 transition-colors
                            cursor-pointer min-w-0">
                    <div class="inline-flex flex-wrap items-baseline gap-x-2 min-w-0">
                        <span class="text-sm font-medium text-blue-600">{{ item.nickName }}</span>
                        <template v-if="item.parentName">
                            <span class="text-gray-400 text-xs">回复</span>
                            <span class="text-sm text-purple-600">@{{ item.parentName }}</span>
                        </template>
                        <span class="text-gray-600 text-sm break-words whitespace-normal flex-shrink-0">: {{
                            item.content }}</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
const props = defineProps({
    info: {
        type: Object,
        default: () => { }
    }
})


</script>

<style scoped lang="scss">
/* 你可以在这里添加其他样式 */
</style>